// 封装关于本地存储的方法
const TokenKey = 'hm-mobile-77-token'
const HistoryList = 'hm-mobile=77-history'
// 存储token的
export const setToken = (newTokenInfo) => {
  localStorage.setItem(TokenKey, JSON.stringify(newTokenInfo))
}
// 获取token的
export const getToken = () => {
  return JSON.parse(localStorage.getItem(TokenKey))
}
// 删除token的
export const removeToken = () => {
  localStorage.removeItem(TokenKey)
}
// 存储历史
export const setHistory = (history) => {
  localStorage.setItem(HistoryList, JSON.stringify(history))
}
// 获取历史
export const getHistory = () => {
  return JSON.parse(localStorage.getItem(HistoryList))
}
// 删除历史
export const removeHistory = () => {
  localStorage.removeItem(HistoryList)
}
